load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "debug",
    srcs = [
        "cpuprofile.go",
        "logspy.go",
        "queries_writer.go",
        "server.go",
        "vmodule.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/server/debug",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/base",
        "//pkg/base/serverident",
        "//pkg/kv/kvserver",
        "//pkg/kv/kvserver/closedts/sidetransport",
        "//pkg/multitenant/tenantcapabilities",
        "//pkg/roachpb",
        "//pkg/server/debug/goroutineui",
        "//pkg/server/debug/pprofui",
        "//pkg/server/debug/replay",
        "//pkg/server/serverpb",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/storage",
        "//pkg/util/encoding/csv",
        "//pkg/util/log",
        "//pkg/util/log/channel",
        "//pkg/util/log/logpb",
        "//pkg/util/log/severity",
        "//pkg/util/stop",
        "//pkg/util/timeutil",
        "//pkg/util/uint128",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_cockroachdb_pebble//:pebble",
        "@com_github_cockroachdb_pebble//tool",
        "@com_github_cockroachdb_pebble//vfs",
        "@com_github_cockroachdb_redact//:redact",
        "@com_github_rcrowley_go_metrics//:go-metrics",
        "@com_github_rcrowley_go_metrics//exp",
        "@com_github_spf13_cobra//:cobra",
        "@org_golang_x_net//trace",
    ],
)

go_test(
    name = "debug_test",
    size = "small",
    srcs = [
        "debug_test.go",
        "logspy_test.go",
        "main_test.go",
    ],
    embed = [":debug"],
    deps = [
        "//pkg/base",
        "//pkg/kv/kvclient/kvtenant",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/server/srvtestutils",
        "//pkg/testutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/log/logpb",
        "//pkg/util/syncutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
